// 入口页面的公共逻辑

export default {
  data() {
    return {
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 单个数据id
      id: "",
      // 类型
      type: "LIST",


      UPDATE: "UPDATE",
      ADD: "ADD",
      DETAIL: "DETAIL",
      LIST: "LIST",
    }
  },
  methods: {
    addHandle(message) {
      this.open = message.open
      this.title = message.title
      this.type = message.type
    },
    updateHandle(message) {
      this.id = message.id;
      this.title = message.title
      this.open = message.open
      this.type = message.type
    },
    detailHandle(message) {
      this.id = message.id;
      this.title = message.title
      this.open = message.open
      this.type = message.type
    },
    cancelHandle() {
      this.type = this.LIST;
      this.open = false;
    },
    reloadHandle() {
      this.$refs.list.getList();
    }
  }
}
